using System.Collections.Generic;
using DynamicChart.Model;
using DynamicChart.Service;
using Microsoft.AspNetCore.Mvc;

namespace DynamicChart.Controllers;

[ApiController]
[Route("[controller]/[action]")]
public class ScreenChartController : ControllerBase
{
    private readonly ScreenChartService _screenChartService;

    public ScreenChartController(ScreenChartService screenChartService)
    {
        _screenChartService = screenChartService;
    }
    
    [HttpGet]
    public ScreenChartModel LoadScreenChartModel(int id)
    {
        return _screenChartService.LoadScreenChartModel(id);
    }
    
    [HttpPost]
    public ScreenChartModel Save([FromBody] ScreenChartModel screenChartModel)
    {
        return _screenChartService.Save(screenChartModel);
    }
}